package staff

import (
	"duoke/service"
	"duoke/utils/gconv"
	"duoke/utils/request"
	"duoke/utils/response"
	"github.com/gin-gonic/gin"
)

var Goods = new(goodsCtl)

type goodsCtl struct{}

func (ctl *goodsCtl) Info(c *gin.Context) {
	req := request.JsonMap(c)
	goods, err := service.Goods.GetById(gconv.Int(req["goodsId"]), "")
	if err != nil {
		response.Error(c, err.Error(), nil)
		return
	}
	response.Success(c, "", goods)
}
